#CROSS=

CC=$(CROSS)gcc
CPP=$(CROSS)g++
STRIP=$(CROSS)strip

TARGET_INSTALL_DIR=./../target/lib

BIN= $(TARGET_INSTALL_DIR)/libFormDataParse.so


.PHONY: all after-all

all: $(BIN) $(DEMO) after-all

after-all :
	rm -rf *.o

INCLUDE =

LD_LIBS = 

CXXFLAGS = $(LD_LIBS) $(INCLUDE) -O2 -std=c++17 -lrt -pthread -lpthread -ldl -lm -Wall -DBSD=1

TGT = $(SRC_C:.c=.o) $(SRC_CPP:.cpp=.o)

SRC_C = $(wildcard *.c)
SRC_CPP = $(wildcard *.cpp)


$(BIN) : $(TGT) 
	$(CPP) $(CXXFLAGS) -Wall -fPIC -s -shared ./*.o -o $(BIN) -lrt
	$(STRIP) $(BIN)


%.o:%.c
	$(CC) -c $? -s -O2  $(CXXFLAGS) -fPIC -o ./$@
%.o:%.cpp
	$(CPP) -c $? -s -O2  $(CXXFLAGS) -fPIC -o ./$@

clean :
	rm -rf *.o *.so $(DEMO)
